#include"square.h"

#ifdef _MAC_OS_
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#endif

void
Square::draw() const{
  glColor3f(_color[0], _color[1], _color[2]);

  glBegin (GL_TRIANGLES);
  glVertex2f (_pos[0], _pos[1]);
  glVertex2f (_pos[0], _pos[1] + _dim[1]);
  glVertex2f (_pos[0] + _dim[0], _pos[1]);
                                                               
  glVertex2f (_pos[0] + _dim[0], _pos[1] + _dim[1]); 
  glVertex2f (_pos[0], _pos[1] + _dim[1]);
  glVertex2f (_pos[0] + _dim[0], _pos[1]);

  glEnd (); 
}


const vec2f&
Square::getdim(){
  return _dim;
}


void Square::update()
{
  _pos += _speed;
  decelerate();
}

/*
void Square::decelerate()
{
  _speed *= deceleration;
}

void Square::grow()
{
  _dim += 0.0001;
}

void Square::shrink()
{
  _dim -= 0.0001;
}
*/


